#include<iostream>
#include<vector>
#include<queue>
#include<cstring>
#include<cmath>
#include<map>
#include<set>
#include<cstdio>
#include<algorithm>
#define debug(a) cout<<#a<<"="<<a<<endl;
using namespace std;
const int maxn=100;
typedef long long LL;
LL a[maxn],b[maxn];
bool vis[1010];
int main(void)
{
  cin.tie(0);std::ios::sync_with_stdio(false);
  LL t;cin>>t;
  while(t--){
    LL n,x;cin>>n>>x;
    memset(vis,0,sizeof(vis));
    for(LL i=1;i<=n;i++) cin>>a[i];
    for(LL i=1;i<=n;i++) cin>>b[i];
    for(LL i=1;i<=n;i++){
        for(LL j=n;j>=1;j--){
            if(vis[j]==0&&b[j]+a[i]<=x){
                ///cout<<"j="<<j<<endl;
                vis[j]=1;
                break;
            }
        }
    }
    bool flag=1;
    for(LL i=1;i<=n;i++){
        if(!vis[i]){
            flag=0;break;
        }
    }
    if(flag==1){
        cout<<"YES"<<endl;
    }
    else cout<<"NO"<<endl;
  }
return 0;
}
